package com.example.chapter1.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import  com.example.chapter1.exception.MyExpection;

@Controller
public class HelloController {

    @RequestMapping("/hello")
    public String hello() throws MyExpection{
        return "hello";
    }

    @RequestMapping("login")
    public String login(){
        return "login";
    }

    @RequestMapping("/")
    public String index(ModelMap map) {
        map.addAttribute("host", "http://blog.didispace.com");
        return "index";
    }

}
